import java.util.HashMap;
import java.util.Scanner;

public class MeanMode {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        scanner.skip("(\\r\\n|[\\n\\r\\u2028\\u2029\\u0085])?");
        String str = scanner.nextLine();
        String[] arr = str.split(" ");
        double[] nums = new double[str.length()];
        double mean = 0;
        double sum = 0;
        for (int i=0;i<n;i++) {
            nums[i] = Double.valueOf(arr[i]);
            sum = sum + nums[i];
        }
        mean = sum/n;
        HashMap<Double,Integer> kv = new HashMap<Double, Integer>();
        for (int i = 0; i <n ; i++) {
            for (int j = 1; j < n-i; j++) {
                if(nums[j-1]>nums[j]){
                    double tmp = nums[j];
                    nums[j] = nums[j-1];
                    nums[j-1] = tmp;
                }
            }
        }
        for (int i = 0; i <n ; i++) {
            if (kv.containsKey(nums[i])) {
                int t = kv.get(nums[i]) + 1;
                kv.put(nums[i], t);
            } else {
                kv.put(nums[i], 1);
            }
        }
        double median = 0;
        if(n%2 != 0){
            median = nums[n/2+1];
        }else {
            median = (nums[n/2]+nums[n/2-1])/2;
        }
        System.out.println(kv.toString());
        int modeNum = 0;
        int mode = 0;
        if(kv.keySet().size() == n){
            mode = Double.valueOf(nums[0]).intValue();
        }else {
            for (double d:kv.keySet()) {
                if(kv.get(d)>modeNum){
                    modeNum = kv.get(d);
                    mode = Double.valueOf(d).intValue();
                }
            }
        }
        System.out.println(mean);
        System.out.println(median);
        System.out.println(mode);
    }
}
